#include "sweep.hpp"
void game()
{
    char mine[ROWS][COLS] = {0};
    char show[ROWS][COLS] = {0};
    InitBoard(mine, ROWS, COLS, '0');
    InitBoard(show, ROWS, COLS, '*');
    SetMine(mine, ROW, COL);
    Displayboard(show, ROW, COL);
    FindMine(mine, show, ROW, COL);
}
void menu()
{
    cout << "************************" << endl;
    cout << "***   1. play     ******" << endl;
    cout << "***   0. exit     ******" << endl;
    cout << "************************" << endl;
}
void test()
{
    srand((unsigned int)time(NULL));
    int input = 0;
    do
    {
        menu();
        cout << "请选择: > ";
        cin >> input;
        switch (input)
        {
        case 1:
            game();
            break;
        case 0:
            cout << "游戏结束, 退出游戏! " << endl;
            break;
        default:
            cout << "输入错误, 请重新选择: " << endl;
            break;
        }
    } while (input);
}
int main()
{
    test();
    return 0;
}